 package com.szy.diary;

import android.app.Activity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.webkit.*;
import android.widget.*;
import java.util.*;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
		viewinit();
    }

	private void viewinit()
	{
		WebView timer=findViewById(R.id.timer);
		TextView month,day;
		month=findViewById(R.id.month);
		day=findViewById(R.id.day);
		//getSupportActionBar().hide();
		Calendar date=Calendar.getInstance();
		month.setText(date.get(Calendar.MONTH)+1+"月");
		day.setText(date.get(Calendar.DAY_OF_MONTH)+"日");
		timer.loadUrl("file:///android_asset/index.html");
		timer.setBackgroundColor(0);
		WebSettings settings = timer.getSettings(); 
		settings.setUseWideViewPort(true);
		settings.setLoadWithOverviewMode(true);
		settings.setJavaScriptEnabled(true);
		settings.setSupportZoom(false);
	}
    
}
